package com.ihr360.payroll.service.salaryfield.impl;

import com.ihr360.authority.sharing.annonation.AccessControl;
import com.ihr360.payroll.dao.SalaryFieldRepository;
import com.ihr360.payroll.model.dto.salary.meta.SalaryField;
import com.ihr360.payroll.service.salaryfield.SalaryFieldService;
import com.ihr360.rest.reposity.SimpleRestReposity;
import com.ihr360.rest.service.AbstractSimpleRestServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AccessControl(disableAll = true)
public class SalaryFieldServiceImpl extends AbstractSimpleRestServiceImpl<SalaryField,Long> implements SalaryFieldService {

    @Autowired
    private SalaryFieldRepository salaryFieldRepository;

    @Override
    public SimpleRestReposity<SalaryField, Long> getSimpleRestReposity() {
        return salaryFieldRepository;
    }

    @Override
    public List<SalaryField> querySystemFieldType(Long systemFieldId) {
        return salaryFieldRepository.findByMetaId(systemFieldId);
    }
}
